
package com.shangsi.controller;

import com.shangsi.model.TAccount;
import com.shangsi.service.AccountService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author dzd
 * @date 2021-12-19
 */
@RestController
public class AccountController {

    @Resource
    private AccountService accountService;

    @PostMapping("decrease")
    public Boolean decrease(@RequestParam("amount")Integer amount,@RequestParam("userId") Integer userId){
        TAccount tAccount=new TAccount();
        tAccount.setAmount(amount);
        tAccount.setUserId(userId);
        return accountService.decrease(tAccount);
    }
}
